#include"ground.h"
ground::ground()
{
    image.load(":/new/prefix1/flappybird/land.png");
    rect=QRect(0,540,1000,140);
    timerId=startTimer(100);
}

void ground::move()
{
  int x=rect.x()-15 ;
  int y=rect.y();
  rect.moveTo(x,y);
  if(x<-100)
      rect.moveTo(0,540);
}

QRect ground::getRect()
{
    return  rect;
}

QImage &ground::getImage()
{
    return image;
}

void ground::timerEvent(QTimerEvent *)
{
      move();
}
